package cn.xiaolang.function.jdk8.functional_interface;

import java.util.function.Consumer;

/**
 * 消费型接口
 * <p>
 * 对类型T参数操作，无返回结果，包含方法 void accept(T t)
 * </p>
 *
 * @author fuhw/Dean
 * @date 2019-07-19
 */
public class ConsumerInterface {

    public static void main(String[] args) {
        handle(12, System.out::println);
        handle(20,a->{
            a = a+100;
            System.out.println(a);
        });
    }


    private static void handle(double money, Consumer<Double> consumer) {
        consumer.accept(money);
    }
}
